<span page-title ng-model="deb">{{ 'Repositories for Deb: ' | translate }} {{ deb.name }}_{{ deb.version }}_{{ deb.architecture }}</span>

<h3 translate>Library Repositories that contain this Deb.</h3>

<div data-extend-template="layouts/partials/table.html">
  <span data-block="no-rows-message" translate>
    No Repositories contain this Deb
  </span>

  <span data-block="no-search-results-message" translate>
    Your search returned zero Repositories
  </span>

  <div data-block="table">
    <table class="table table-striped table-bordered" ng-class="{'table-mask': table.working}">
      <thead>
        <tr bst-table-head>
          <th bst-table-column="name"><span translate>Name</span></th>
          <th bst-table-column="product"><span translate>Product</span></th>
          <th bst-table-column="lastSync"><span translate>Last Sync</span></th>
        </tr>
      </thead>

      <tbody>
        <tr bst-table-row ng-repeat="repository in table.rows">
          <td bst-table-cell>
            <a ui-sref="product.repository.info({productId: repository.product.id, repositoryId: repository.library_instance_id || repository.id})">
              {{ repository.name }}
            </a>
          </td>
          <td bst-table-cell>
            <a ui-sref="repositories({productId: repository.product.id})">
              {{ repository.product.name }}
            </a>
          </td>
          <td bst-table-cell>
              <span ng-show="repository.url">
              <span ng-show="repository.last_sync == null" translate>
                Not Synced
              </span>
              <span ng-hide="repository.last_sync == null">
                <a ng-href="/foreman_tasks/tasks/{{repository.last_sync.id}}">{{ repository.last_sync.result | capitalize}}</a>
                <span translate>{{ repository.last_sync_words }} ago</span>
              </span>
            </span>
            <span ng-hide="repository.url" translate>N/A</span>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</div>
